<?php
require_once 'mysql.php' ;
require_once 'class_project.php' ;
function viewMeters() {
	
	$present = query('SELECT * FROM project');
	$i=0;
	while ($row = mysql_fetch_array($present))
	{
		$projects[$i] = new project;
		$projects[$i]->affect($row);
		$i++;
	}
	$result = '<tr>
    <td>';
    $i=0;
	foreach ($projects as $p ) {
	
		$result .= '<div class="PDMain">
<div class="meterBox">
      <div class="filler"><span class="indenter">50%</span> </div>
    </div>
	<a href="#" onClick="swapLayers(\'Layer'.$i.'\');">Project #'.$p->pid.': '.$p->name.'</a>
</div>'; 
$i++;
	}
	
return $result;
}
function pDesc()
{
	//<div id="Layer1" style="position:absolute; width:362px; height:226px; z-index:1; left: 436px; top: 84px; visibility: hidden;" class="descMain">fds</div>
	$present = query('SELECT * FROM project');
	$i=0;
	while ($row = mysql_fetch_array($present))
	{
		$projects[$i] = new project;
		$projects[$i]->affect($row);
		$i++;
	}
	$i=0;
	$result="";
	foreach ($projects as $p ) {
	
		$result .= '<div id="Layer'.$i.'" style="position:absolute; width:362px; height:226px; z-index:1; left: 436px; top: 84px; visibility: hidden;" class="descMain">';
		$result .= '<h3>'.$p->name.'</h3><p>Description:<br/>'.$p->description.'</p>'; 	
		$result .= '</div>';
		$i++;
	}
	return $result;
}

?>
